package com.hospital.patient.controller;

import com.hospital.common.domain.patient.Department;
import com.hospital.common.result.R;
import com.hospital.patient.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：sjc
 * @Description:
 * @name：DepartmentController
 * @Date：2024/10/20 16:18
 */
@RestController
@RequestMapping("department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /**
     * 根据关键字查询科室
     * @param str
     * @return
     */
    @GetMapping("findDepartment/{str}")
    public R<List<Department>> findDepartment(@PathVariable("str") String str){
        List<Department> department = departmentService.findDepartment(str);
        return R.success(department);
    }





}
